package hikari.preferences.scene_parameters;

import hikari.gui.AskDialog;
import hikari.persistence.propertieseditor.EditorPanel;
import hikari.preferences.SceneProperties;
import java.awt.Window;
import javax.swing.JPanel;

/**
 * @author Dmitry
 */
public class SceneConfigurationDialog extends AskDialog {
    private SceneProperties properties;
    private EditorPanel editorPanel;

    public SceneConfigurationDialog(Window parent, SceneProperties properties) {
        super(parent);
        this.properties = properties;
    }

    @Override
    protected void createContent(JPanel container) {
        editorPanel = new EditorPanel();
        editorPanel.fillPanelWithData(properties);
        container.add(editorPanel);
    }

    @Override
    protected boolean onOK() {
        editorPanel.saveBackToObject();
        return true;
    }

    @Override
    public String getDialogName() {
        return "SceneConfigDialog";
    }
}
